package summer_vacation.lvchang.myyVacation;

/**
 * Created by Administrator on 2015/9/6.
 */
public class Text9 {
    public static void main(String[] args) {
        int[]arr=new int[]{12,49,76,45,24};
        for (int i=0;i<arr.length ;i++ )
        {
            for (int j=i+1;j<arr.length;j++ )
            {
                if(arr[i]>arr[j])
                {
                    int tep=arr[i];//实现两个变量的值互换，由此可以排列出数组从小到大
                    arr[i]=arr[j];
                    arr[j]=tep;

                }
            }
            System.out.print(arr[i]+" ");//第一次跳出内循环：arr{9,12,56,45,10}第二次跳出：arr{9,10,56,45,12}
        }
    }
    }
